1. Field of the Invention
The present invention relates to a memory controller and a control method for the same. More specifically, it relates to a memory card or a memory device in which a nonvolatile semiconductor memory, such as NAND flash memory, is embedded.
2. Description of the Related Art
In the case of writing data in a memory component, such as a flash memory, the amount of data to be written at one time may be fixed. In addition, with a higher level apparatus, such as a computer with a file system, a unit of write-in data is determined separately from the memory component. The write-in unit of data for the memory component may be larger than that for a higher level apparatus (apparatus employing a memory card: host) such as a write-in unit of 2048 bytes for the memory component and a write-in unit of 512 bytes for the higher level apparatus.
The memory device, such as a memory card, is embedded with a memory component that writes in such large units of data and responds to a write-in instruction from the higher level apparatus. The memory device must also be capable of processing write-in of a small unit of data.
When the allowable unit of data write-in for the higher level apparatus is small (e.g., 512 bytes) and that for the nonvolatile memory component is large (e.g., 2048 bytes), after writing small unit data D1 in the nonvolatile memory component from the higher level apparatus, small unit data D2 may be written in an area subsequent to the page in which the data D1 is written. There may be a flash memory that does not allow division of a page to write in data. In this case, that flash memory must copy data other than the data D1, from the block including the data D1, into another block and write the data D1 and D2 in that other block. Such processing is hereafter referred to as ‘sacrificed moving’ for convenience sake. When this ‘sacrificed moving’ occurs frequently, as it accompanies an operation of copying un-rewritable data, write-in performance of the memory device is impaired. Therefore, there is a problem that writing in a flash memory typically used as the nonvolatile memory component takes a long time.
Note that a high-speed write-in method of temporally storing write-in data from a host in a nonvolatile memory and processing the write-in data under control of a memory controller, and then writing the data back in a cache memory, when booting an apparatus after processing, has been interrupted due to power failure or the like is disclosed in Japanese Laid-open Patent Application No. Hei 5-151094.